// component/cart/cart.js
var app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    isReload:{
      type:Boolean,
      value: false,
      observer: function(newVal, oldVal){
        if(newVal){
          this.onPullDownRefresh();
        }
        return newVal;
      }
    },
    isReachBottom:{
      type:Boolean,
      value: false,
      observer: function(newVal, oldVal){
        console.log(newVal);
        if(newVal){
          this.onReachBottom();
        }
        return newVal;
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    nocheckIconUrl: '../../images/icon_nocheck.png',
    checkIconUrl: '../../images/icon_checked_red.png',
    shopname: '',
    checkedAll: false,
    delDisabled: false,
    isEdit: false,
    cartList: [],
    sumPrice: 0,
    showLoading: true,
    noMoretip: false,
    page: 0,
    isloading: false,
    isShowNummodal: false,
    shopInfo:null
  },
  lifetimes: {
    attached: function() {
    },
    detached: function() {
      // 在组件实例被从页面节点树移除时执行
    },
  },

  pageLifetimes: {
    // 组件所在页面的生命周期函数
    show: function () { 
      var that = this;
    wx.getStorage({
      key: 'shopInfoname',
      success: function (res) {
        that.setData({
          shopname: res.data
        })
      }
    })
    that.getSlient();
    that.onPullDownRefresh();
    console.log(app.globalData.requestUrl);                                         
    that.setData({
      isHasunionid: app.globalData.isHasunionid,
      haveVcmCard: app.globalData.haveVcmCard
    });
    app.setCartnum();//更新购物车数量
    },
    hide: function () { },
  },
  /**
   * 组件的方法列表
   */
  methods: {
    
  }
})
